Add 18 models by similarity by UILogicId#961
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to link hardware models based on similarity both by their name and UILogicId. Key changes include refactoring file saving into a reusable function, introducing a new helper function to add symlinks for similar models, and adding several new hardware model files in the designated directory.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/check_for_similar_models.py | Refactored saving functionality, added _add_models_by_similarity, and now generates both models_map.json and ui_logic_map.json. |
| deebot_client/hardware/deebot/*.py (multiple files) | Added new hardware model files containing model identifiers. |
Comments suppressed due to low confidence (5)
scripts/check_for_similar_models.py:83
- The variable name 'map' shadows the built-in function. Consider renaming it to 'mapping' or 'model_map' for clarity.
for map in (name_map, ui_logic_map):
deebot_client/hardware/deebot/m17zko.py:1
- [nitpick] Duplicate hardware model identifier 'yinacl.py' appears (also in p1wg05.py). Verify if this duplication is intentional or if each model should be unique.
yinacl.py
deebot_client/hardware/deebot/8o3xke.py:1
- [nitpick] The identifier 'xco2fc.py' appears in multiple files (e.g., k1lgm7.py and 8o3xke.py). Confirm that duplicate identifiers are expected in the hardware models.
xco2fc.py
deebot_client/hardware/deebot/7c26ui.py:1
- [nitpick] Duplicate hardware model identifier 'c8rj4y.py' detected (also in bheggm.py). Please verify if this repetition aligns with design expectations.
c8rj4y.py
deebot_client/hardware/deebot/6cibhb.py:1
- [nitpick] The hardware model identifier '2px96q.py' is duplicated (also in qhq6i0.py). Ensure that this duplication is intentional.
2px96q.py
| os.symlink( | ||
| f"{model_to_link}.py", | ||
| f"{model}.py", | ||
| dir_fd=os.open("deebot_client/hardware/deebot", os.O_RDONLY), | ||
| ) |
There was a problem hiding this comment.
Consider handling potential exceptions (e.g., FileExistsError) when creating a symlink to avoid runtime errors if the link already exists.
| os.symlink( | |
| f"{model_to_link}.py", | |
| f"{model}.py", | |
| dir_fd=os.open("deebot_client/hardware/deebot", os.O_RDONLY), | |
| ) | |
| try: | |
| os.symlink( | |
| f"{model_to_link}.py", | |
| f"{model}.py", | |
| dir_fd=os.open("deebot_client/hardware/deebot", os.O_RDONLY), | |
| ) | |
| except FileExistsError: | |
| logging.warning(f"Symbolic link for {model} already exists. Skipping.") |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## dev #961 +/- ##
=======================================
Coverage 93.60% 93.60%
=======================================
Files 128 128
Lines 4975 4975
Branches 324 324
=======================================
Hits 4657 4657
Misses 258 258
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #961 will not alter performanceComparing Summary
|
Fixes #700 fixes #814